<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<title>小米商城后台管理系统</title>
	<link rel="stylesheet" type="text/css" href="/Public/css/type.css" />
	<script src="/Public/js/jquery.min.js"></script>
</head>
<body class="admin_layout">
<header class="admin_header">
	<h2>小米商城后台管理系统</h2> 
  <ul>
		<li>欢迎您：</li>
		<li><a href="/index.php?s=/Admin/Administrator/modifySellerInformation"><?php echo ($_SESSION['admin_name']); ?>&emsp;</a></li>
		<li>|</li>
		<li><a href="/index.php?s=">&emsp;前台首页&emsp;</a></li>
		<li>|</li>
		<li><a href="/index.php?s=/Admin/Administrator/logout"  onClick="return confirm('您确定要退出本站?');">&emsp;退出登录&emsp;</a></li>
	</ul>
  
</header>


<div class="admin_main">
<aside class="sidebar" id="selector">
	<ul>
		<li><a href="/index.php?s=/Admin/Index/index" id="">后台首页</a></li>
		<li><a href="/index.php?s=/Admin/Goodcategory/index" id="">分类管理</a></li>
		<li><a href="/index.php?s=/Admin/Goodattribute/checkGoodAttribute" id="">商品属性</a></li>
		<li><a href="/index.php?s=/Admin/Goods/checkGoods" id="">商品管理</a></li>
		<li><a href="/index.php?s=/Admin/Goods/recycleIndex" id="">下架商品</a></li>
		<li><a href="/index.php?s=/Admin/Order/index" id="">订单管理</a></li>
		<li><a href="/index.php?s=/Admin/Orderdetail/index" id="">评论管理</a></li>
	<li><a href="/index.php?s=/Admin/User/index" id="">顾客管理</a></li>
</ul>
</aside>
<section class="admin_section">
	<div>
	<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>小米商城后台管理系统</title>
<link rel="stylesheet" type="text/css" href="/Public/css/type.css" />
<script type="text/javascript" src="/Public/js/admin.js"></script>


<script>
$(function(){
	$("#categorysel").change(function(){
		window.location.href = "/index.php?s=/Admin/Goods/recycleIndex/GoodcategoryId/" + $("#categorysel").val();
	});
});
</script>

<style>
/*分页列表*/
.pagelist {
	text-align: center;
	margin-top: 10px;
}

.pagelist a {
	margin: 0 5px;
	border: 1px solid #ddd;
	padding: 1px 4px;
	color: #666;
}

.pagelist a:hover {
	text-decoration: none;
}

.pagelist span {
	padding: 1px 4px;
}
</style>

</head>
<body>
<br>
<br>
<form method="post">
<table class="classify_table1">
	<tr>
		<td><span class="classify_table_title">下架商品</span> <span
			class="classify_table_button"> <input type="button"
			id="delselect_btn" value="删除"> </span> <span
			class="classify_table_button"> <input type="button"
			id="huanyuanselect_btn" value="还原"> </span>
		</span></td>
	</tr>
	<tr>
		<td>
		<table class="classify_table2">
			<tr>
				<td class="classify_thead_checkbox"><input type="checkbox"
					onclick="DoCheck()" name="allChecked" id="allChecked"></td>
				<td class="classify_thead_title">商品编号</td>
				<td class="classify_thead_title">商品名称</td>
				<td class="classify_thead_title">商品颜色</td>
				<td class="classify_thead_title">商品型号</td>
				<td class="classify_thead_title ">分类 <select id="categorysel"
					name="GoodcategoryId">
					<option value="0">全部</option>
					<?php if(is_array($goodcategory)): foreach($goodcategory as $key=>$v): ?><option value="<?php echo ($v["GoodcategoryId"]); ?>"<?php if(($v["GoodcategoryId"]) == $GoodcategoryId): ?>selected<?php endif; ?>
					><?php echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;',$v['deep']).$v['CategoryName'];?></option><?php endforeach; endif; ?>
				</select></td>
				<td class="classify_thead_title " colspan="2">修改</td>
			</tr>
			<?php if(is_array($goods["list"])): foreach($goods["list"] as $key=>$v): ?><tr>
				<td class="classify_thead_checkbox"><input type="checkbox"
					name="goodids[]" class="choose" value="<?php echo $v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>"></td>
				<td class="classify_tbody"><?php echo ($v["GoodId"]); ?></td>
				<td class="classify_tbody"><?php echo ($v["GoodName"]); ?></td>
				<td class="classify_tbody"><?php echo ($v["Color"]); ?></td>
				<td class="classify_tbody"><?php echo ($v["Version"]); ?></td>
				<td class="classify_tbody"><?php echo ($v["CategoryName"]); ?></td>
				<td>
				
				<input type="button" value="编辑" onclick="javascrtpt:window.location.href='/index.php?s=/Admin/Goods/modifyGoods/goodids/<?php echo $v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>'">
				</td>
				<td>
				<input type="button" value="删除" onClick="if(confirm('确定删除?'))javascrtpt:window.location.href='/index.php?s=/Admin/Goods/deleteGoods/GoodcategoryId/<?php echo ($GoodcategoryId); ?>/goodids/<?php echo $v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>'";else return;">
				</td>
			</tr><?php endforeach; endif; ?>

		</table>
		</td>
	</tr>
	<tr>
		<td>
		<div class="pagelist"><?php echo ($goods["page"]); ?></div>
		</td>
	</tr>
</table>

</form>

<script>
//批量下架时使用



$('#delselect_btn').click(function(){
	if($(".choose:checked").length<=0){
		alert("勾选至少一个属性复选框，才能进行本操作！");
		retrun;}
	if(confirm('操作后将无法找回这些商品，确定删除?'))
	{
		$('form').attr('action','/index.php?s=/Admin/Goods/delSelect/GoodcategoryId/<?php echo ($GoodcategoryId); ?>');
		$('form').submit();
	}

});

$('#huanyuanselect_btn').click(function(){
	if($(".choose:checked").length<=0){
		alert("勾选至少一个属性复选框，才能进行本操作！");
		retrun;}
	if(confirm('确定还原(上架)这些商品?'))
	{
		$('form').attr('action','/index.php?s=/Admin/Goods/huanyuanselect/GoodcategoryId/<?php echo ($GoodcategoryId); ?>');
		$('form').submit();
	}

});

</script>
</body>
</html>
	</div>
</section>
</div>
</body>
</html>